<!--<?php
require_once template('header'); 
print <<<EOT
<!--右边开始-->
<div id="right">
	<table class="clst" align="center" cellpadding="0" cellspacing="1">
		<tr>
			<td class="tleft">商品分类</td>
			<td class="tright"><a href="admincp.php?module=category&action=add" class="but1">分类添加</a></td>
		</tr>
	</table>
	<div class="list-div" id="listDiv">
	<table cellpadding="0" cellspacing="1" class="list" id="tree_list">
		<tr>
			<th width="40%">分类名称</th>
			<th width="12%">是否激活</th>
			<th width="12%">输出顺序</th>
			<th width="12%">添加商品</th>
			<th width="12%">分类添加</th>
			<th width="12%">操作</th>
		</tr>
<!--
EOT;
foreach ($arr_tree as $key=>$val){
print <<<EOT
--> 
    <tr align="center" class="$val[2]" style="background:#f1f1f1;">
    	<td align="left" class="td1"><img src="images/admincp/minus.gif" style="margin-left:$val[2]em" onclick="rowClicked(this)" /> <span><a href="admincp.php?module=goods&action=list&ps_cate=$key">$val[0]</a></span></td>
    	<td>$val[3]</td>
   	 	<td>$val[4]</td>
    	<td><a href="admincp.php?module=goods&action=add&goods_category=$key">添加商品</a></td>
   	 	<td><a href="admincp.php?module=$module&amp;action=add&amp;category_id=$key">分类添加</a></td>
    	<td><a href="admincp.php?module=$module&amp;action=edit&amp;uid=$key">编辑</a> |  <a href="admincp.php?module=$module&amp;action=del&amp;uid=$key" onclick="return really()">删除</a></td>
  </tr>
<!--
EOT;
} print <<<EOT
-->	   
  </table>
<script language="JavaScript">
<!--
var Browser = new Object();
Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument != 'undefined');
Browser.isIE = window.ActiveXObject ? true : false;
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != - 1);
Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != - 1);
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != - 1);
var imgPlus = new Image();
imgPlus.src = "images/admincp/plus.gif";

//折叠分类列表
function rowClicked(obj)
{
  obj = obj.parentNode.parentNode;

  var tbl = document.getElementById("tree_list");
  var lvl = parseInt(obj.className);
  var fnd = false;

  for (i = 0; i < tbl.rows.length; i++)
  {
      var row = tbl.rows[i];

      if (tbl.rows[i] == obj)
      {
          fnd = true;
      }
      else
      {
          if (fnd == true)
          {
              var cur = parseInt(row.className);
              if (cur > lvl)
              {
                  row.style.display = (row.style.display != 'none') ? 'none' : (Browser.isIE) ? 'block' : 'table-row';
              }
              else
              {
                  fnd = false;
                  break;
              }
          }
      }
  }

  for (i = 0; i < obj.cells[0].childNodes.length; i++)
  {
      var imgObj = obj.cells[0].childNodes[i];
      if (imgObj.tagName == "IMG" && imgObj.src != 'images/admincp/arrow.gif')
      {
          imgObj.src = (imgObj.src == imgPlus.src) ? 'images/admincp/minus.gif' : imgPlus.src;
      }
  }
}
//-->
</script>
	</div>
</div>
<!--
EOT;
?>-->

